#ifndef __MAIN_H
#define __MAIN_H
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include "gd32f4xx.h"

#define YEAR ((((__DATE__[7] - '0')*10 + (__DATE__[8] - '0'))*10 + (__DATE__[9] - '0'))*10 + (__DATE__[10] - '0'))
#define MONTH (__DATE__[2] == 'n' ? 0\
              :__DATE__[2] == 'b' ? 1\
              :__DATE__[2] == 'r' ? (__DATE__[0] == 'M' ? 2 : 3)\
              :__DATE__[2] == 'y' ? 4\
              :__DATE__[2] == 'n' ? 5\
              :__DATE__[2] == 'l' ? 6\
              :__DATE__[2] == 'g' ? 7\
              :__DATE__[2] == 'p' ? 8\
              :__DATE__[2] == 't' ? 9\
              :__DATE__[2] == 'v' ? 10 : 11)
#define DAY ((__DATE__[4] == ' ' ? 0 : __DATE__[4] - '0')*10 + (__DATE__[5] - '0'))

#define HOUR    ((__TIME__[0] - '0')*10 + __TIME__[1] - '0')
#define MINUTE  ((__TIME__[3] - '0')*10 + __TIME__[4] - '0')
#define SECOND  ((__TIME__[6] - '0')*10 + __TIME__[7] - '0')

#define TIME_OUT_1MS   2
#define TIME_OUT_2MS   (2*TIME_OUT_1MS)
#define TIME_OUT_5MS   (5*TIME_OUT_1MS)
#define TIME_OUT_10MS  (10*TIME_OUT_1MS)
#define TIME_OUT_100MS (10*TIME_OUT_10MS)
#define TIME_OUT_250MS (50*TIME_OUT_5MS)
#define TIME_OUT_500MS (5*TIME_OUT_100MS)

extern uint8_t g_ai_com_ch;
extern uint8_t g_ai_select_sn;


#endif /* __MAIN_H */


